Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch dev server + prod build to vite! #1535

Merged
merged 33 commits into from
Jan 6, 2024
Merged

Switch dev server + prod build to vite! #1535

merged 33 commits into from
Jan 6, 2024

Conversation

calebeby
Copy link
Member

@calebeby calebeby commented Dec 19, 2023

Wheeee!

image

Finally got this working! The first time I tried to switch this project over to vite was in 2019 when vite was first published. About every year since then, I've come back to this trying to get it to work but there have always been roadblocks (ehem, Linaria, Jest, ESM support...). Last year I got pretty close but now I had some time to finally get it across the finish line!

Before, we were using Webpack 4 (very old) for the dev server and Rollup for the production build. Now, we are using Vite for both (well, Vite uses Rollup under the hood for the build).

Sorry, this is a big PR, but it had to be. I didn't see any way to incrementally migrate the build system over.

Testing:

  • make sure the local dev server works:
    • Make sure you have node 18+ installed
    • Run npm install
    • Run npm run dev
    • Open localhost:2733 in your browser, click through the app, make sure things are working
    • Make local changes to files and make sure they are injected into the localhost version of the app
  • Make sure the production build works:
    • Make sure you have node 18+ installed
    • Run npm install
    • Run npm run build
    • Run npm run preview to startup a preview server of the production-built app
    • Open localhost:2733 in your browser, click through the app, make sure things are working

@calebeby calebeby requested a review from varCepheid December 19, 2023 04:17
@calebeby calebeby marked this pull request as ready for review December 19, 2023 04:20
Copy link
Collaborator

@varCepheid varCepheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well on my machine! I'll wait to make sure it works on others as well, but mine is probably the oldest and slowest we're going to be using. The only issues I noticed were A. it's just very slow for some reason, and B. the icon doesn't load, although that doesn't really matter.

@varCepheid
Copy link
Collaborator

Works also on Pigmice's Lenovos (at least the one I'm typing this from, but the two are largely identical). Tested the login form and videos and nothing went wrong. I realized that I didn't try doing the production version on my home computer, so I'll try that soon. I'll leave it to @ev118 to approve.

Copy link
Contributor

@ev118 ev118 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@calebeby calebeby added this pull request to the merge queue Jan 6, 2024
Merged via the queue into dev with commit 2ecff41 Jan 6, 2024
12 checks passed
@calebeby calebeby deleted the vite-working branch January 6, 2024 03:04
github-merge-queue bot pushed a commit that referenced this pull request Mar 8, 2024
* Get vite to mostly work

Co-authored-by: Elijah Vennebush <[email protected]>
Co-authored-by: Alex <[email protected]>

* Fix postcss config and delete more unused

* Fix tests

* Remove unused babel plugins

* Adjust rollup config

* Fix Service Worker and PWA stuff

* Update to type:module in package.json

* Undo needless change src -> @

* Undo more needless changes?

* For now, undo linaria changes in all files

* Remove unrelated change

* Undo more changes

* Remove more deps (will have to add back some of these)

* Dep updates since last time I worked on this

* Set up new version of linaria

* Fix a silly CSS bug

* Use port 2733 for preview as well

* Fix TS imports

* Increase min chunk size for chunk merging

* Remove unmaintained postcss-font-magician

* Update node LTS minimum

* Replace Jest with Vitest for less config

* Downgrade TS to avoid needing to update eslint-plugin-caleb in this PR

* Remove unused old rollup config

* Undo upgrading preact to avoid needing to fix type stuff in this PR

* Re-update preact to fix integration with vite and prefresh

* Fix chart where polished lib was included at runtime

* Fix type errors

* Use node 18 in CI

* Delete commented code

* Run prettier on html files too

---------

Co-authored-by: Elijah Vennebush <[email protected]>
Co-authored-by: Alex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants